/**
 * Created by Administrator on 2017/6/13.
 */
// 用于加载对应的房间配置
var config = require('./config');
var constVar = require ('./const');

module.exports = {

    /**
     * 检查创建房间的参数
     * @param args
     * @return -1 表示参数不正确，
     */
    checkCreateRoomArgs: function(args) {
        if (!args.gameType || !args.subType || !args.round) {
            return false;
        }

        if (!config.RoundCard.hasOwnProperty(args.round)) {
            return false;
        }

        return true;
    },

    /**
     * 创建房间需要消耗的资源
     * @param args
     */
    calcCreateRoomNeedResource: function(args) {

        var costCard = config.RoundCard[args.round];

        //// 需要获取轮数来进行钻石消耗的判断
        //if (args.topRound == constVar.extCostTurn.add.turns) {
        //    costCard += constVar.extCostTurn.add.cost;
        //}
        //
        //// 需要获取必闷轮数进行钻石消耗的判断
        //if (args.menRound == constVar.extCostTurn.men.turns) {
        //    costCard += constVar.extCostTurn.add.cost;
        //}

        return {
            "card": costCard
        };
    }
}